﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterSite.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Application.Default" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" src="../js/jquery.js"></script>
   
    <script type="text/javascript">
        $(document).ready(function () {
           
         //   alert('страница перезагрузилась');

            $(".Tabs").children().hide();
            $("#Clean").addClass("current");
            $("#Content").append($(".CleanContent"));
            $(".CleanContent").show();

            $(".menuItem").click(function () {

                $(".menuItem").children().removeClass("current");
                $(this).children().addClass("current");

                if (($(this).children().attr("id")).indexOf("menuHome") != -1) {
                    $("#Content").children().hide();
                    $("#Content").append($(".HomeContent"));
                    $(".HomeContent").show();
                }

                if (($(this).children().attr("id")).indexOf("menuProject") != -1) {
                    if ($("#Content").children())
                        $("#Content").children().hide();
                    //    $("#Content").empty();
                    $("#Content").append($(".ProjectContent"));
                    $(".ProjectContent").show();
                }

                if (($(this).children().attr("id")).indexOf("menuTask") != -1) {
                    if ($("#Content").children())
                        $("#Content").children().hide();
                    //      $("#Content").empty();
                    $("#Content").append($(".TaskContent"));
                    $(".TaskContent").show();
                }

                if ((($(this).children().attr("id")).indexOf("menuUser") != -1)) {
                    if ($("#Content").children())
                        $("#Content").children().hide();
                    $("#Content").append($(".UserContent"));
                    $(".UserContent").show();
                }

                if ((($(this).children().attr("id")).indexOf("menuNews") != -1)) {
                    $("#Content").children().hide();
                    $("#Content").append($(".NewsContent"));
                    $(".NewsContent").show();
                }


            });

            //            var url = location.pathname.toLowerCase();

            //            if (url.indexOf("projects") != -1)
            //                $("#menuProject").addClass("current");
            //            else if (url.indexOf("tasks") != -1)
            //                $("#menuTask").addClass("current");
            //            else if (url.indexOf("users") != -1)
            //                $("#menuUser").addClass("current");
            //            else if (url.indexOf("view") != -1)
            //                $("#menuView").addClass("current");

        });
    </script>
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <div id="head">
        <div id="headTitle">
            Система управления проектами
        </div>
        <div id="menu">
            <div class="menuItem">
                <a href="#" id="Clean" class="menuLink">Пустая </a>
            </div>
            <div class="menuItem">
                <a href="#" id="menuHome" class="menuLink" runat="server">Моя страница </a>
            </div>
            <div class="menuItem">
                <a href="#" id="menuProject" class="menuLink" runat="server">Проекты</a>
            </div>
            <div class="menuItem">
                <a href="#" id="menuTask" class="menuLink" runat="server">Задачи</a>
            </div>
            <div class="menuItem">
                <a href="#" id="menuUser" class="menuLink" runat="server">Пользователи</a>
            </div>
            <div class="menuItem">
                <a href="#" id="menuNews" class="menuLink" runat="server">Новости </a>
            </div>
        </div>
    </div>
    <div id="Content">
    </div>
    <asp:Panel runat="server" Class="Tabs" Style="display: none">
        <asp:Panel ID="CleanContent" runat="server" Class="CleanContent">
            <asp:Label runat="server"> Пустая страница </asp:Label>
        </asp:Panel>
        <asp:Panel ID="HomeContent" runat="server" Class="HomeContent">
            <CSG:Login ID="Login" runat="server" />
        </asp:Panel>
        <asp:Panel ID="ProjectContent" runat="server" Class="ProjectContent">
            <CSG:ProjectForm ID="PrForm" runat="server" />
            <CSG:ProjectList ID="PrList" runat="server" />
            <CSG:UserInProject ID="UserPr" runat="server" />
        </asp:Panel>
        <asp:Panel ID="TaskContent" runat="server" Class="TaskContent">
            <CSG:TaskForm ID="TaskForm" runat="server" />
            <CSG:TaskList ID="TaskList" runat="server" />
        </asp:Panel>
        <asp:Panel ID="UserContent" runat="server" Class="UserContent">
            <CSG:UserForm ID="UserForm" runat="server" />
            <CSG:UserList ID="UserList" runat="server" />
        </asp:Panel>
        <asp:Panel ID="NewsContent" runat="server" Class="NewsContent">
            <asp:Label runat="server"> Последние обновления </asp:Label>
        </asp:Panel>
    </asp:Panel>
</asp:Content>
